<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>子节点</title>
</head>

<body>

    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>



</body>

<script>
    var ul = document.querySelector('ul');
    console.log(ul);

    console.log('子节点');
    console.log(ul.childNodes);
    console.log('纯子节点');

    var array = new Array();
    var is = 0;
    for (var i = 0; i < ul.childNodes.length; i++) {
        if (ul.childNodes[i].nodeType == 1) {
            console.log(ul.childNodes[i]);
            array[is] = (ul.childNodes[i]);
            is++;
        }
    }
    console.log(array);
    console.log('常用的操作');

    console.log(ul.children);
</script>

</html>